Wiki
Clone wikiwebdialog / Javascript Events
The dialog can be made richer by adding elements to the index.html template, and writing listeners in static/js/views.js which update them. Here is a list of all events you can listen for using:
window.dialog.on(event_name, function(e, [...]) { // code });
The list has the event_name, and then the list of arguments which get passed along to the listeners (after the first argument, which is always an Event object).
"tts_start"
[text
]"tts_end"
[]"response"
[responseObject
] -responseObject
is the object returned in JSON by theupdate
function of the DialogState."asr_result"
[asr
] -asr
is the object returned by the WebSpeech API. This gives incremental results."dialog_started"
[]"dialog_stopped"
[]"listening"
[]"not_listening"
[]"error"
[error_text
]
Updated